package com.ljkj.blockpay.ui.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.RadioGroup;

import com.kongzue.baseokhttp.util.JsonMap;
import com.ljkj.blockpay.R;
import com.ljkj.blockpay.basedata.BaseActivity;
import com.ljkj.blockpay.databinding.ActivityPrimaryAuthentBinding;
import com.ljkj.blockpay.databinding.ActivityRealNameAuthenticationBinding;
import com.ljkj.blockpay.presenter.PrimaryAuthenPresenter;
import com.ljkj.blockpay.presenter.RealNameAuthentPresenter;
import com.ljkj.blockpay.presenter.inter.RealAuthentInter;
import com.ljkj.blockpay.widget.ClickListener;
import com.luck.picture.lib.tools.ToastUtils;


/**
 * 初级认证页面
 */
public class PrimaryAuthentActivity extends BaseActivity<ActivityPrimaryAuthentBinding, RealNameAuthentPresenter> implements RealAuthentInter.RealAuthentInterView, ClickListener {

    private String name;
    private String firstname;
    private String birthday;
    private String country;
    private String zjtype;
    private String certifcatetype;
    private String startday;
    private String endday;
    @Override
    public int initContentView() {
        return R.layout.activity_primary_authent;
    }

    @Override
    protected RealNameAuthentPresenter createPresenter() {
        return new RealNameAuthentPresenter(this,this);
    }

    @Override
    protected void init(Bundle savedInstanceState) {

    }

    @Override
    protected void initData() {
        super.initData();
        binding.setOnClick(this::onClick);
        name = binding.etName.getText().toString();
        firstname = binding.etFirstnames.getText().toString();
        birthday = binding.etBirthday.getText().toString();
        country = binding.etCountry.getText().toString();
        zjtype = binding.tvType.getText().toString();
        certifcatetype = binding.etCertificatetype.getText().toString();
        startday = binding.tvStartday.getText().toString();
        endday = binding.tvEndday.getText().toString();

    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.rg_sex:

                break;
            case R.id.et_birthday:

                break;
            case R.id.rl_country:
                break;

            case R.id.tv_type:

                break;
            case R.id.et_certificatetype:

                break;
            case R.id.tv_startday:

                break;
            case R.id.tv_endday:

                break;
            case R.id.iv_sfz:

                break;
            case R.id.iv_sfzrear:

                break;
            case R.id.btn_upload:
                if (name.isEmpty()){
                    ToastUtils.s(this,"名字不能为空");
                }else if (firstname.isEmpty()){
                    ToastUtils.s(this,"姓不能为空");
                } else if (birthday.isEmpty()){
                    ToastUtils.s(this,"生日不能为空");
                }else if (country.isEmpty()){
                    ToastUtils.s(this,"国家不能为空");
                }else if (zjtype.isEmpty()){
                    ToastUtils.s(this,"证件类型不能为空");
                }else if (certifcatetype.isEmpty()){
                    ToastUtils.s(this,"证件号不能为空");
                }else if (startday.isEmpty()){
                    ToastUtils.s(this,"开始日期不能为空");
                }else if (endday.isEmpty()){
                    ToastUtils.s(this,"结束日期不能为空");
                } else {

//                    getPresenter().primarysubmit("","","","","","","","");
                }
                break;
            default:
                break;
        }
    }

    @Override
    public void statusSuccess(JsonMap jsonMap) {

    }

    //初级认证
    @Override
    public void primarySuccess(JsonMap jsonMap) {


    }

    @Override
    public void seniorSuccess(JsonMap jsonMap) {

    }
}